Add environment-aware new thread picker - #4426
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Needs human review This PR introduces a new feature with significant new UI flows, command palette logic, keybinding changes, and migration behavior. The scope and complexity of new user-facing behavior warrant human review. You can customize Macroscope's approvability policy. Learn more. |
f1dd61f to
cf4f7c9
Compare
fb31222 to
139d17e
Compare
1b619d5 to
a93d1ea
Compare
Original local work that existed only in the pingdotgg#4426 stack-compat patch; no topic branch defines it. CommandPalette.tsx imports these three symbols.
# Conflicts: # apps/web/src/commandPaletteBus.ts # apps/web/src/components/CommandPalette.logic.test.ts # apps/web/src/components/CommandPalette.tsx # apps/web/src/environmentGrouping.test.ts # apps/web/src/keybindings.test.ts # packages/contracts/src/keybindings.test.ts # packages/shared/src/keybindings.ts
Adds pingdotgg#4590 to the thread-picker group rather than the main manifest: it edits the same CommandPalette trio, and specifically the browse/submit region that pingdotgg#4257 and pingdotgg#4426 also touch, so the combination resolves once against upstream main instead of being re-derived every refresh. Group rebuilt (reproduce) to b15922f and repinned in stack.toml; main stack refreshed. The group rebuild reproduced tree bad6ae3 across two independent runs, and the assembled tree keeps every pingdotgg#4590 gating site plus the composer path-search error. The one non-mechanical resolution: the group had already extracted the palette empty-state ternary into `contextualEmptyStateMessage` + `resolveCommandPaletteEmptyStateMessage`, so pingdotgg#4590's inline branch was rewritten onto that helper instead of taking either side verbatim.
# Conflicts: # apps/web/src/commandPaletteBus.ts # apps/web/src/components/CommandPalette.logic.test.ts # apps/web/src/components/CommandPalette.tsx # apps/web/src/environmentGrouping.test.ts # apps/web/src/keybindings.test.ts # packages/contracts/src/keybindings.test.ts # packages/shared/src/keybindings.ts
… and pingdotgg#4599 The published build already carried pingdotgg#4605 and pingdotgg#4599 -- stack-build-info.json on t3code/stack lists both -- but the manifest edits that admitted them were never committed here, so the recorded intent had drifted from the artifact and a rebuild would have dropped two features. Restore them at the OIDs the published build resolved, then append pingdotgg#4624. pingdotgg#4624 is closed upstream without merging; carried because the replay cost is real on this phone. Its head carries a fix past the PR: the 200ms code-highlight debounces could never fire, because a growing code block's React key encodes its source offsets and the block remounts on every delta. Also refresh two pins that the artifact had moved past (the thread-picker group and local/nix-flake), and re-audit the exception set: the group rebuild at c5a4a73 shrank the CommandPalette losses on pingdotgg#4263/pingdotgg#4258/pingdotgg#4426 from 29/28/19 to 3/3/4. pingdotgg#4590's waiver is rewritten -- its 32 missing lines are an unbuilt branch revision, not a resolution loss, because the group is still pinned at the older member head.
a93d1ea to
a1a1520
Compare
# Conflicts: # apps/web/src/commandPaletteBus.ts # apps/web/src/components/CommandPalette.logic.test.ts # apps/web/src/components/CommandPalette.tsx # apps/web/src/environmentGrouping.test.ts # apps/web/src/keybindings.test.ts # packages/contracts/src/keybindings.test.ts # packages/shared/src/keybindings.ts
# Conflicts: # apps/web/src/commandPaletteBus.ts # apps/web/src/components/CommandPalette.logic.test.ts # apps/web/src/components/CommandPalette.tsx # apps/web/src/environmentGrouping.test.ts # apps/web/src/keybindings.test.ts # packages/contracts/src/keybindings.test.ts # packages/shared/src/keybindings.ts
All 41 writable topics were rebased onto upstream b4680cb and force-pushed, so every pin here moved. The thread-picker group was rebuilt at the new member heads, which also clears the stale-pin gap that had pingdotgg#4590's newer revision sitting in no build. Two cumulative branches -- t3code/client-suite (37 commits) and t3code/unify-environment-selection (41) -- were replayed as a single content-identical commit each rather than rebased commit-by-commit. They rewrite their own files repeatedly, so each intermediate replay conflicted against a state present in no final tree and with no oracle to resolve it against; that is how the sidebar host-name and accent-color features were lost once before. Applying base..tip instead reproduced both contributions exactly -- verified line for line: 113 files / 6269 added lines and 131 files / 6686 added lines, both unchanged. Old heads are preserved under refs/refresh-backup/. Removed stack/patches/t3code-command-palette-logic-helpers.patch from the group manifest. It predated the members carrying those helpers themselves: it deleted shouldHandleCommandPaletteShortcut and shouldClearAddProjectEnvironmentOnPop and stripped isLoaded from resolveNewThreadOnIntent, while adding three helpers nothing in the assembled tree calls. Once the members were rebased, the assembled CommandPalette.tsx imported both deleted symbols, and the web build failed with two MISSING_EXPORT errors. Dropping it also shrank the audited CommandPalette losses on pingdotgg#4263/pingdotgg#4258/pingdotgg#4426 from 10/7/7 to 3/3/4. Added patches/t3code-dedupe-environment-icon.patch. client-suite and unify-environment-selection each add the same EnvironmentIcon helper to BranchToolbarEnvironmentSelector.tsx; git merges both without conflict and the result fails to parse. Genuinely stack-emergent, so it cannot live on either topic. Only the esbuild syntax gate catches this class -- the content audit looks for missing lines, not duplicated ones. pingdotgg#4624 is now a branch-linked topic with no `pr` key: it was closed upstream without merging, so the branch is authoritative and the entry must not be dropped on account of the PR's state. Ladder: syntax gate clean, content audit exits 0, nix build exits 0, smoke check exits 0.
a1a1520 to
9394441
Compare
9394441 to
6ace64e
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6ace64e. Configure here.

What Changed
chat.newEnvironmentcommand on Mod+Shift+N.Run onlist; the primary environment is labeled with its runtime hostname instead ofLocal.chat.newLocaldefault while preserving customchat.newLocalbindings.Why
Thread creation previously collapsed projects across environments and silently selected one machine. This makes execution location explicit without treating local as a separate mode.
UI Changes
Environment selection:
Environment-scoped project selection:
Checklist
vp checkcompletes with only existing warnings outside this change.vp run typecheckis blocked by the existing interactive Astro dependency prompt and existing unrelated web type errors; changed packages/files introduce no reported type errors.Note
Medium Risk
Default shortcut behavior changes for all users who relied on Mod+Shift+N for instant local threads; migration is narrow but still touches persisted keybinding config on startup.
Overview
Mod+Shift+N now runs
chat.newEnvironment, opening the command palette on a “New thread on…” flow instead of immediately starting a local thread.chat.newLocalremains available for custom bindings but is no longer the default on that chord.The palette adds a flat Run on list of environments (with per-environment project submenus), waits until environment shells are bootstrapped before opening, and closes if nothing is available. Project rows are built with
targetEnvironmentIdso choices stay on the chosen machine rather than falling back to another environment’s project.On the server, startup keybinding sync migrates only the exact legacy default (
mod+shift+n+chat.newLocal+!terminalFocus) tochat.newEnvironment, leaving otherchat.newLocalentries (e.g.mod+shift+l) untouched. Contracts and settings exposechat.newEnvironmentvia exportedSTATIC_KEYBINDING_COMMANDS.Reviewed by Cursor Bugbot for commit 5e2155e. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add environment-aware new thread picker with
chat.newEnvironmentcommandmod+shift+nvia the newchat.newEnvironmentcommand.DEFAULT_KEYBINDINGSin shared/src/keybindings.ts to bindmod+shift+ntochat.newEnvironmentinstead ofchat.newLocal.buildSidebarProjectPickerEntriesto accept an optionaltargetEnvironmentId, scoping project entries to that environment without falling back to other machines.chat.newLocaldefault is found without achat.newEnvironmentbinding, it is automatically replaced.mod+shift+nnow opens the environment picker palette instead of directly creating a local thread; users with customizedchat.newLocalbindings on other keys are unaffected.Macroscope summarized 5e2155e.